#! /usr/local/bin/python3

from re import compile
from sys import argv

def main():
    filename = argv[1]
    pattern = r'\$[0-9.]+\b'
    obj = compile(pattern)
    with open(filename) as f:
        s = f.readlines()
        s = ''.join(s)
    sum = 0
    for string in obj.findall(s):
        sum += float(string[1:])
    print(sum)

if __name__ == "__main__":
    main()